//
//  OrderDetailHeaderView.m
//  ForestPack
//
//  Created by jimmy on 2018/7/23.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "OrderDetailHeaderView.h"
#import "Masonry.h"

@implementation OrderDetailHeaderView

+(OrderDetailHeaderView *)headerViewWithHeight:(CGFloat )height
{
    OrderDetailHeaderView *view = [[OrderDetailHeaderView alloc] initWithHeight:(CGFloat )height];
    
    return view;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UIImageView * leftImageV = [[UIImageView alloc] init];
    leftImageV.image = [UIImage imageNamed:@"公告"];
    leftImageV.layer.masksToBounds = YES;
    leftImageV.layer.cornerRadius = 24;
    [self addSubview:leftImageV];
    [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(13));
        make.centerY.equalTo(self);
        make.width.height.equalTo(@(48));
    }];
    
    UILabel *nameLabel = [[UILabel alloc] init];
    nameLabel.text = @"雇主";
    nameLabel.textColor = FONTCOLOR_BLACK;
    nameLabel.textAlignment = NSTextAlignmentLeft;
    nameLabel.font = Kfont(18);
    [self addSubview:nameLabel];
    [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(leftImageV.mas_right).offset(10);
        make.centerY.equalTo(self.mas_centerY);
        make.width.equalTo(@80);
        make.height.equalTo(@20);
    }];
    
    UILabel *lineLabel = [[UILabel alloc] init];
    [self addSubview:lineLabel];
    [lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.bottom.equalTo(self.mas_bottom).offset(-1);
        make.width.equalTo(@(SCREEN_WIDTH));
        make.height.equalTo(@1);
    }];
    lineLabel.backgroundColor = LineColor;
    
    
}

@end


@interface BiddingPeopleCountView()


@end

@implementation BiddingPeopleCountView

+(BiddingPeopleCountView *)headerViewWithHeight:(CGFloat )height
{
    BiddingPeopleCountView *view = [[BiddingPeopleCountView alloc] initWithHeight:(CGFloat )height];
    
    return view;
}

- (instancetype)initWithHeight:(CGFloat)height
{
    self = [super init];
    if (self) {
        [self setViewUIWithHeight:height];
    }
    return self;
}

- (void)setViewUIWithHeight:(CGFloat)height
{
    UILabel *peopleCount = [[UILabel alloc] init];
    peopleCount.text = @"竞标人数";
    peopleCount.textColor = FONTCOLOR_BLACK;
    peopleCount.textAlignment = NSTextAlignmentLeft;
    peopleCount.font = Kfont(14);
    [self addSubview:peopleCount];
    [peopleCount mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13);
        make.top.equalTo(self.mas_top).offset(10);
        make.width.equalTo(@100);
        make.height.equalTo(@24);
    }];
    
    UILabel *countLabel = [[UILabel alloc] init];
    countLabel.text = @"666";
    countLabel.textColor = RGB_COLOR(237,34,59);
    countLabel.textAlignment = NSTextAlignmentRight;
    countLabel.font = Kfont(14);
    [self addSubview:countLabel];
    [countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.mas_right).offset(-13);
        make.top.equalTo(self.mas_top).offset(10);
        make.width.equalTo(@100);
        make.height.equalTo(@24);
    }];
    
    UILabel *lineLabel = [[UILabel alloc] init];
    lineLabel.backgroundColor = LineColor;
    [self addSubview:lineLabel];
    [lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left);
        make.top.equalTo(self.mas_bottom).offset(-1);
        make.width.equalTo(@(SCREEN_WIDTH));
        make.height.equalTo(@1);
    }];
}
@end

